(defun next-iter(x)
  (+ 2 (/ 1 x)))

(defun collect-no(iter)
  (loop for i from 1 to iter
       for x = (next-iter 2) then (next-iter x)
       collect (- x 1)))

(defun validp(no)
  (> (digits-no (numerator no)) (digits-no (denominator no))))

(defun probl057-old()
  (loop for i in (collect-no 1000) when (validp i) count i))


(defun probl057()
  (loop for i from 1 to 1000
     for x = (next-iter 2) then (next-iter x)
     when (validp (- x 1)) count i))
